package com.tianji.learning.controller;


import com.tianji.common.domain.dto.PageDTO;
import com.tianji.learning.domain.dto.ReplyDTO;
import com.tianji.learning.domain.vo.ReplyVO;
import com.tianji.learning.query.ReplyPageQuery;
import com.tianji.learning.service.IInteractionReplyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 互动问题的回答或评论 前端控制器
 * </p>
 *
 * @author yang
 * @since 2024-06-25
 */
@Api(tags = "互动回答相关接口-前端评论")
@RestController
@RequestMapping("/replies")
@RequiredArgsConstructor
public class InteractionReplyController {
    private final IInteractionReplyService replyService;

    @PostMapping
    @ApiOperation("新增互动回答")
    void addReply(@RequestBody ReplyDTO replyDTO){
        replyService.addReply(replyDTO);
    }

    @GetMapping("/page")
    @ApiOperation("分页查询互动回答列表-前端")
    PageDTO<ReplyVO> getReplyPage(ReplyPageQuery query){
        return replyService.getReplyPage(query,false);
    }



}
